/*
 * 出现这种写法是因为设计失误, 为了避免遇到交叉引用, 尽量少用
 * @Author: czy0729
 * @Date: 2020-12-04 11:04:51
 * @Last Modified by: czy0729
 * @Last Modified time: 2025-08-19 20:42:07
 */
import type { RakuenStoreType } from '../../stores/rakuen'
import type { SystemStoreType } from '../../stores/system'
import type { ThemeStoreType } from '../../stores/theme'
import type { UIStoreType } from '../../stores/ui'
import type { UserStoreType } from '../../stores/user'

/** [同步] 获取 userStore */
export function syncUserStore() {
  return require('../../stores/user').default as UserStoreType
}

/** [同步] 获取 themeStore */
export function syncThemeStore() {
  return require('../../stores/theme').default as ThemeStoreType
}

/** [同步] 获取 systemStore */
export function syncSystemStore() {
  return require('../../stores/system').default as SystemStoreType
}

/** [同步] 获取 uiStore */
export function syncUIStore() {
  return require('../../stores/ui').default as UIStoreType
}

/** [同步] 获取 rakuenStore */
export function syncRakuenStore() {
  return require('../../stores/rakuen').default as RakuenStoreType
}

/** [同步] 自动判断是否简体转繁体 */
export function syncS2T(str: any = ''): string {
  if (typeof str !== 'string') return str

  return syncSystemStore().setting.s2t ? require('../thirdParty/open-cc').s2t(str) : str
}

/** [同步] 自动判断是否简体转繁体 */
export function syncSpacing(str: any = ''): string {
  if (typeof str !== 'string') return str

  return syncSystemStore().setting.spacing ? require('../thirdParty/pangu-lite').spacing(str) : str
}
